<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <t:base type="jquery,easyui,tools,DatePicker,ckeditor"></t:base>
    <link rel="stylesheet" href="${webRoot}/plug-in/lhgDialog/skins/blue.css"/>
    <link rel="stylesheet" href="${webRoot}/plug-in/lhgDialog/skins/default.css"/>
    <script type="text/javascript" src="${webRoot}/plug-in/ajaxfileupload/ajaxfileupload.js"></script>
    <script type="text/javascript" charset="utf-8"
            src="${webRoot}/plug-in/ueditor1_4_3-utf8-jsp/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8"
            src="${webRoot}/plug-in/ueditor1_4_3-utf8-jsp/ueditor.all.min.js"></script>
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8"
            src="${webRoot}/plug-in/ueditor1_4_3-utf8-jsp/lang/zh-cn/zh-cn.js"></script>
    <script type="text/javascript" charset="utf-8" src="${webRoot}/plug-in/QQgeo/geo.js"></script>
    <script type="text/javascript" charset="utf-8" src="${webRoot}/plug-in/My97DatePicker/WdatePicker.js"></script>
</head>
<body scroll="no">
<t:formvalid formid="addformobj" dialog="true" usePlugin="password" layout="table"
             action="csResultController.do?saveorupdate" beforeSubmit="checkInfor">
    <input name="id" type="hidden" value="${entity.id}">
    <input name="dimEntity.id" type="hidden" value="${entity.dimEntity.id}"/>

    <div class="new_table_list">
        <table cellpadding="0" cellspacing="0" class="formtable">
            <tbody>
            <tr>
                <th colspan="2">结果分析信息</th>
            </tr>
            <tr>
                <td align="left" style="width: 100px">
                    <label class="Validform_label">
                        结果名称:
                    </label>
                </td>
                <td class="txt_left value">
                    <input class="inputxt" style="width: 250px;" id="name" name="name" value="${entity.name}"
                           datatype="*"
                           maxlength="128">
                    <span class="Validform_checktip"></span>
                </td>
            </tr>
            <tr>
                <td align="left" style="width: 100px">
                    <label class="Validform_label">
                        开始分值:
                    </label>
                </td>
                <td class="txt_left value">
                    <input class="inputxt" style="width: 250px;" id="beginScore" name="beginScore" value="${entity.beginScore}"
                           datatype="num"
                           maxlength="128">
                    <span class="Validform_checktip"></span>
                </td>
            </tr>
            <tr>
                <td align="left" style="width: 100px">
                    <label class="Validform_label">
                        结束分值:
                    </label>
                </td>
                <td class="txt_left value">
                    <input class="inputxt" style="width: 250px;" id="endScore" name="endScore" value="${entity.endScore}"
                           datatype="num"
                           maxlength="128">
                    <span class="Validform_checktip"></span>
                </td>
            </tr>
            <tr>
                <td align="left" style="width: 100px">
                    <label class="Validform_label">
                        结果描述:
                    </label>
                </td>
                <td class="txt_left value">
                    <textarea style="width:250px;height: 100px;" name="resultDesc">${entity.resultDesc}</textarea>
                </td>
            </tr>
        </table>
    </div>
</t:formvalid>
<script type="text/javascript">
    $(function () {

//        $("#quesType").children().first().remove();
//        $("#effective").children().first().remove();
    });


    function checkInfor() {
        var beginScore = $("#beginScore").val();
        var endScore = $("#endScore").val();
        if(!(parseFloat(endScore)-parseFloat(beginScore)>0)){
            tip("开始分值必须小于结束分值");
            return false;
        }

        <%--var quesId = "${entity.questEntity.id}";//量表id--%>
        <%--var id = "${entity.id}";//问题id--%>
        <%--var name = $("#name").val();//问题--%>
        <%--var url = "quesquesController.do?checkName";--%>
        <%--var flag = false;--%>
        <%--$.ajax({--%>
        <%--url : url,--%>
        <%--async : false, // 注意此处需要同步，因为返回完数据后，下面才能让结果的第一条selected--%>
        <%--type : "GET",--%>
        <%--dataType : "json",--%>
        <%--data: { quesId: quesId,id:id,name:name },--%>
        <%--success : function(data) {--%>
        <%--if(data.code==1){--%>
        <%--tip(data.msg);--%>
        <%--}else{--%>
        <%--flag = true;--%>
        <%--}--%>
        <%--}--%>
        <%--});--%>
        <%--return flag;--%>
    }


</script>
</body>

</html>